package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.AduStudentMapper;
import com.ruoyi.system.domain.AduStudent;
import com.ruoyi.system.service.IAduStudentService;
import com.ruoyi.common.core.text.Convert;

/**
 * 学生Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-03-04
 */
@Service
public class AduStudentServiceImpl implements IAduStudentService 
{
    @Autowired
    private AduStudentMapper aduStudentMapper;

    /**
     * 查询学生
     * 
     * @param studentId 学生主键
     * @return 学生
     */
    @Override
    public AduStudent selectAduStudentByStudentId(Long studentId)
    {
        return aduStudentMapper.selectAduStudentByStudentId(studentId);
    }

    /**
     * 查询学生列表
     * 
     * @param aduStudent 学生
     * @return 学生
     */
    @Override
    public List<AduStudent> selectAduStudentList(AduStudent aduStudent)
    {
        return aduStudentMapper.selectAduStudentList(aduStudent);
    }

    /**
     * 新增学生
     * 
     * @param aduStudent 学生
     * @return 结果
     */
    @Override
    public int insertAduStudent(AduStudent aduStudent)
    {
        aduStudent.setCreateTime(DateUtils.getNowDate());
        return aduStudentMapper.insertAduStudent(aduStudent);
    }

    /**
     * 修改学生
     * 
     * @param aduStudent 学生
     * @return 结果
     */
    @Override
    public int updateAduStudent(AduStudent aduStudent)
    {
        aduStudent.setUpdateTime(DateUtils.getNowDate());
        return aduStudentMapper.updateAduStudent(aduStudent);
    }

    /**
     * 批量删除学生
     * 
     * @param studentIds 需要删除的学生主键
     * @return 结果
     */
    @Override
    public int deleteAduStudentByStudentIds(String studentIds)
    {
        return aduStudentMapper.deleteAduStudentByStudentIds(Convert.toStrArray(studentIds));
    }

    /**
     * 删除学生信息
     * 
     * @param studentId 学生主键
     * @return 结果
     */
    @Override
    public int deleteAduStudentByStudentId(Long studentId)
    {
        return aduStudentMapper.deleteAduStudentByStudentId(studentId);
    }
}
